package bookstudytest.operationFile.file;




import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * @author heng.li
 * @Auther: Lee
 * @Date: 2018/6/22 11:02
 * @Description:
 */
public class PathDemo {
    public static void main(String[] args) throws IOException {
        Path path = Paths.get("C:\\Users\\Administrator\\Desktop\\1212.txt");
        Path path1 = Paths.get("D:\\a.txt");
        //读取文件的所有内容
        byte[] bytes = Files.readAllBytes(path);
        String s = new String(bytes);
        System.out.println(s);
        //文件中写
        Files.write(path,"你好啊大哥 ".getBytes("UTF-8"));
        //文件复制
        Files.copy(path,path1);
        //文件移动
//        Files.move()

    }
}
